package com.fiberhome.app.network.socket;

import com.fiberhome.app.network.ISender;

/**
 * Created by Deed on 2018/1/18.
 */

public class UdpBuilder extends SocketBuilder {


    /**
     *
     */
    UdpPacket udpPacket;

    /**
     *
     * @param port int
     * @param ipAddress String
     */
    UdpBuilder(int port, String ipAddress) {
        super(port,ipAddress);
    }

    @Override
    public ISender build() {
        return new UdpSender(this);
    }

    /**
     *
     * @param cache boolean
     * @return
     */
    public UdpBuilder useCache(int cache) {
        super.useCache(cache);
        return this;
    }

    /**
     * @param cacheOverdue long
     * @return HttpBuilder
     */
    public UdpBuilder cacheOverdue(long cacheOverdue) {
        super.cacheOverdue(cacheOverdue);
        return this;
    }

    /**
     *
     * @param timeOut value
     * @return UdpBuilder
     */
    public UdpBuilder timeOut(int timeOut) {
        super.timeOut(timeOut);
        return this;
    }

    @Override
    public UdpBuilder sendData(String sendData) {
        super.sendData(sendData);
        return this;
    }

    /**
     *
     * @param udpPacket UdpPacket
     * @return UdpBuilder
     */
    public UdpBuilder packet(UdpPacket udpPacket) {
        this.udpPacket = udpPacket;
        return this;
    }
}
